execute if score game_run system matches 0 as @e[tag=choose_R,type=interaction] at @s on target at @s[team=!red] run function vs:system/hub/joined_red

execute if score game_run system matches 0 as @e[tag=choose_B,type=interaction] at @s on target at @s[team=!blue] run function vs:system/hub/joined_blue

execute if score game_run system matches 0 as @e[tag=choose_S,type=interaction] at @s on target at @s[team=!] run function vs:system/hub/leave_team

execute if score game_run system matches 0 as @a[tag=say] at @s run teammsg 我已成为各位光荣的一员！
execute if score game_run system matches 0 as @a[tag=say] at @s run tag @s remove say

execute as @e[tag=choose_R,type=interaction] at @s run data remove entity @s interaction
execute as @e[tag=choose_B,type=interaction] at @s run data remove entity @s interaction
execute as @e[tag=choose_S,type=interaction] at @s run data remove entity @s interaction